From: Alexander Larsson Date: Thu, 6 Jul 2023 17:31:18 +0000 (+0200) Subject: tests: Fix composefs test X-Git-Tag: archive/raspbian/2023.7-3+rpi1~1^2~9^2^2~63^2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=62e4f376536a86ca8d707a75ffc62a3c728389c3;p=ostree.git tests: Fix composefs test - Was using the wrong metadata key - We were missing setting the canonical commit args which assigns e.g. owner uid 0, which is important for reproducibility - Use the new --print-hex to make things easier to read --- diff --git a/tests/test-composefs.sh b/tests/test-composefs.sh index 9a14e545..90f0e43f 100755 --- a/tests/test-composefs.sh +++ b/tests/test-composefs.sh @@ -29,12 +29,16 @@ setup_test_repository "bare-user" cd ${test_tmpdir} $OSTREE checkout test2 test2-co +rm test2-co/whiteouts -rf # This may or may not exist +COMMIT_ARGS="--owner-uid=0 --owner-gid=0 --no-xattrs --canonical-permissions" $OSTREE commit ${COMMIT_ARGS} -b test-composefs --generate-composefs-metadata test2-co -orig_composefs_digest=$($OSTREE show --print-metadata-key ostree.composefs.v0 test-composefs) -assert_streq "${orig_composefs_digest}" '[byte 0x1f, 0x08, 0xe5, 0x8b, 0x14, 0x3b, 0x75, 0x34, 0x76, 0xb5, 0xef, 0x0c, 0x0c, 0x6e, 0xce, 0xbf, 0xde, 0xbb, 0x6d, 0x40, 0x30, 0x5e, 0x35, 0xbd, 0x6f, 0x8e, 0xc1, 0x9c, 0xd0, 0xd1, 0x5b, 0xae]' +# If the test fails we'll dump this out +$OSTREE ls -RCX test-composefs / +orig_composefs_digest=$($OSTREE show --print-hex --print-metadata-key ostree.composefs.digest.v0 test-composefs) $OSTREE commit ${COMMIT_ARGS} -b test-composefs2 --generate-composefs-metadata test2-co -new_composefs_digest=$($OSTREE show --print-metadata-key ostree.composefs.v0 test-composefs) +new_composefs_digest=$($OSTREE show --print-hex --print-metadata-key ostree.composefs.digest.v0 test-composefs2) assert_streq "${orig_composefs_digest}" "${new_composefs_digest}" +assert_streq "${new_composefs_digest}" "4d97f295ac9d379b7b3c42ddec49cc55b570c5b8b2a6f3f835f473854b0ad0cd" tap_ok "composefs metadata" tap_end